**********************************************************************
Files in this zip file is a set "skeleton" files for making
generic xll add-in files for use with Excel 32 Bit Office 2007 and later.
I've been making xll files in PowerBasic since mid 90-ties. Since I'm not sure there 
will be a 64bit version of PowerBasic in  the near future
I have decided to migrate some of my code to Freebasic 32bit. As said, the included 
files will enable you to create your own add-ins.

The main files are partial translations from c++ files included in the Excel Software Development Kit found here
https://msdn.microsoft.com/en-us/library/office/bb687883.aspx
it is advicable to read the help file there before jumping into coding.


Making 64bit xll files should be quite easy since the 32 bit "infrastructure" works.

Some of the c-compiled libfiles must of course be recompiled with GCC 64 bit 



All code is Copyleft!
Enjoy!
E Dingsor
**********************************************************************
Description of files:

FB_GENERIC_XLL.bas , main file to be compiled. Rename FB_GENERIC_XLL.dll to FB_GENERIC_XLL.xll or whatevername.xll you go for.

xlcall.bi 'Translation of xlcall.h file

framewrkc.bi 'partial translation of framewrk.c file. It contains neccesary exported functions that Excel calls into to recognise the add-in. Study it!

libxlcall32 'conversion of xlcall.lib file in SDK. See FB discussion here: https://freebasic.net/forum/viewtopic.php?f=6&t=26291

xlcall13 'C compilation of xlcall.cpp in SDK. Got problems when trying to convert to FB. Ended up with compling into static c library. See discussion here: https://freebasic.net/forum/viewtopic.php?f=6&t=26406

XL_Pascalstr.bi  'routines for reading and writing zstrings or wstrings

FB_Operarr.bas , utility functions for working with arrays and ranges. Ported from PowerBasic, but not all are tested.

FB_XLRegfunc.bas 'Function declarations for registering Excel functions.

Myfirstfunctions.bas 'example spreadsheet functions

FB_GENERIC_XLL.xll ' compiled add-in

Book1.xlsx 'example file with functions



***************************************
Compilation settings
***************************************
-s gui -dll -export -Wl --subsystem,windows,--kill-at,-e_XLLMAIN

Since FB add's its own dllmain entry function you have to override the dll entrypoint with the -e switch since we want our dll to perform actions at startup. I have aliased my DLLMAIN to XLLMAIN i.e the -e_XLLMAIN setting

